package vip.xiaonuo.modular.business.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.context.login.LoginContextHolder;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.login.SysLoginUser;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.param.BiApplication.EditParam;
import vip.xiaonuo.modular.business.param.BiApplication.QueryParam;
import vip.xiaonuo.modular.business.service.TripartiteApplicationService;
import vip.xiaonuo.modular.entitys.UserIndexTree;
import vip.xiaonuo.modular.manage.biapplication.entity.BiApplication;
import vip.xiaonuo.modular.manage.biapplication.service.BiApplicationService;
import vip.xiaonuo.modular.manage.biuserapplication.service.BiUserApplicationService;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "第三方应用")
@RestController
public class TripartiteApplicationController {

    @Resource
    private TripartiteApplicationService tripartiteApplicationService;

    @ApiOperation("第三方应用菜单查询")
    @PostMapping("/business/biApplication/appList")
    @BusinessLog(title = "第三方应用菜单查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData appList(@RequestBody QueryParam param){
        return new SuccessResponseData(tripartiteApplicationService.appList(param));
    }

    @ApiOperation("第三方应用菜单编辑")
    @PostMapping("/business/biApplication/edit")
    @BusinessLog(title = "第三方应用菜单编辑", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData edit(@RequestBody EditParam param){
        tripartiteApplicationService.edit(param);
        return new SuccessResponseData();
    }
}
